#ifndef LOGR_SITES_H
#define LOGR_SITES_H

#include <sys/stat.h>
#include <sys/fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include <sys/time.h>
#include <assert.h>
#include <gr_graph_fun.h>
#include "LOGR_webstat.h"

typedef struct _web_site_node {
    char * dnssite;
    char * ipsite;
    long naccesses;
    long sbytes;
    long nacc_search;
    long sbytes_search;
    TypeReferer tr;
} WebSiteNodeStruct;

typedef struct _web_site_node *WebSiteNodePtr;

WebSiteNodePtr
new_web_site_node(void);

void
delete_web_site_node(WebSiteNodePtr wsn);

void
LOGR_set_site_dns(WebSiteNodePtr wsn,char *sdns);
void
LOGR_assign_site_dns(WebSiteNodePtr wsn,char *sdns);
const char *
LOGR_get_site_dns(WebSiteNodePtr wsn);
void
LOGR_set_site_ip(WebSiteNodePtr wsn,char *sip);
void
LOGR_assign_site_ip(WebSiteNodePtr wsn,char *sip);
const char *
LOGR_get_site_ip(WebSiteNodePtr wsn);
void
LOGR_set_site_naccesses(WebSiteNodePtr wsn,long num);
long
LOGR_get_site_naccesses(WebSiteNodePtr wsn);
void
LOGR_inc_site_naccesses(WebSiteNodePtr wsn);

void
LOGR_set_site_nacc_search(WebSiteNodePtr wsn,long num);
void
LOGR_inc_site_nacc_search(WebSiteNodePtr wsn);
long
LOGR_get_site_nacc_search(WebSiteNodePtr wsn);

void
LOGR_set_site_sizebytes(WebSiteNodePtr wsn,long num);
void
LOGR_add_site_sizebytes(WebSiteNodePtr wsn,long num);
long
LOGR_get_site_sizebytes(WebSiteNodePtr wsn);

void
LOGR_set_site_sizebytes_search(WebSiteNodePtr wsn,long num);
long
LOGR_get_site_sizebytes_search(WebSiteNodePtr wsn);

void
LOGR_set_site_type_referer(WebSiteNodePtr wsn,TypeReferer tr);
void
LOGR_set_site_type_referer2(WebSiteNodePtr wsn,TypeReferer tr);
TypeReferer
LOGR_get_site_type_referer(WebSiteNodePtr wsn);
int
LOGR_is_access_lower(WebSiteNodePtr u, WebSiteNodePtr v);
int
LOGR_is_access_bigger(WebSiteNodePtr u,WebSiteNodePtr v);
int
LOGR_is_access_search_lower(WebSiteNodePtr u, WebSiteNodePtr v);
int
LOGR_is_access_search_bigger(WebSiteNodePtr u,WebSiteNodePtr v);
int
LOGR_is_access_stat_lower(WebSiteNodePtr u, WebSiteNodePtr v);
int
LOGR_is_access_stat_bigger(WebSiteNodePtr u,WebSiteNodePtr v);



#endif

